package org.dousb.doupicture.infrastructure.common;


import lombok.Data;

import java.io.Serializable;

/**
 * BaseResponse
 *
 * @author 豆沙包
 * @version 1.0
 * @since 2025-09-16  19:28
 */
@Data
public class BaseResponse<T> implements Serializable {

    private static final long serialVersionUID = 1L;

    private int code;
    private T data;
    private String message;

    public BaseResponse(int code, T data, String message) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public BaseResponse(int code, T data) {
        this(code, data, "");
    }

    public BaseResponse(ErrorCode errorCode) {
        this(errorCode.getCode(), null, errorCode.getMessage());
    }
}